package com.dycx.common.dto.handler;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
import com.dycx.common.dto.FileDTO;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;

import java.io.IOException;
import java.util.List;

/**
 * json字段处理
 */

public class IntegerListTypeHandler extends AbstractJsonTypeHandler<List<Integer>> {

    @Override
    protected List<Integer> parse(String json) {
        return JSON.parseArray(json, Integer.class);

    }

    @Override
    protected String toJson(List<Integer> obj) {
        return JSON.toJSONString(obj);
    }
}